package cn.edu.scau.cmi.luotiansheng.singleton;

import java.util.ArrayList;
import java.util.List;

public class GrandMarshal {
	
	private static int max=10;
	private static List<GrandMarshal> instance=new ArrayList<>();
	private String name;
	
	public GrandMarshal(String name) {
		this.name=name;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public static boolean addInstance(GrandMarshal grandMarshal) {
		if(instance.size()<10) {
			instance.add(grandMarshal);
			return true;
		}else {
			return false;
		}
	}
	
	public static List<GrandMarshal> getInstance(){
		return instance;
	}
	
}
